package com.jojo.controller;

import com.jojo.service.DbService;
import com.jojo.service.DfService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.LinkedHashMap;
import java.util.List;

/**
 * @author JOJO
 * @version 1.0
 * @since 1.8
 */
@Controller
public class IndexController {

    @Autowired
    private DbService dbService;
    @Autowired
    private DfService dfService;

    @GetMapping("/index")
    public String index(){
        return "index";
    }

    @ResponseBody
    @GetMapping("/composeDb")
    public LinkedHashMap<Integer, List<String>> composeDb(){
        return dbService.composeDb();
    }

    @ResponseBody
    @GetMapping("/composeDf")
    public LinkedHashMap<Integer, List<String>> composeDf(){
        return dfService.composeDf();
    }
}
